package com.youxin.busfoundation.config;

import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;

/**
 * 设置全局LoadBalancerClient
 * @author yingde.cao
 *
 */
public class WebLoadBalancer {
	private static WebLoadBalancer balancer=new WebLoadBalancer();
	private LoadBalancerClient loadBalancer;
	
	public static void initWithBanlancer(LoadBalancerClient loadBalancer)
	{
		balancer.setLoadBalancer(loadBalancer);
	}

	public LoadBalancerClient getLoadBalancer() {
		return loadBalancer;
	}

	public void setLoadBalancer(LoadBalancerClient loadBalancer) {
		this.loadBalancer = loadBalancer;
	}

	public static WebLoadBalancer instance()
	{
		return balancer;
	}
	
	
}
